<style lang="less">
.jingbiao{
    .btjingbiao{
        width: 10vw;
    }
    .datatitle{
        font-size: 1vw;
    }
    .htmldata{
        width:45vw;
        img{
            width:100%;
        }
        p{
            width:100%;
        }
        span{
            width:100%;
        }
    }

}
</style>
<template>
    <div class="jingbiao">
        <div class="datatitle">{{designerdemanddata.title}}</div>
        <div class="htmldata" v-html="designerdemanddata.detailed_desc"></div>
        <el-form :model="jingbiaoFrom" ref="jbFrom" class="userdata" :rules="rules">
            <el-form-item
                label="出价（¥）"
                prop="bidding_charge"
                >
                <el-input class="name" type="number" placeholder="出价"  v-model="jingbiaoFrom.bidding_charge"></el-input>
            </el-form-item>
            <el-form-item
                label="QQ号"
                prop="qq"
                >
                <el-input class="name"  placeholder="qq"  v-model="jingbiaoFrom.qq"></el-input>
            </el-form-item>
            <el-form-item
                label="备注"
                prop="remark"
                >
                <el-input class="name" type="textarea"  placeholder="备注"  v-model="jingbiaoFrom.remark"></el-input>
            </el-form-item>
        </el-form>
        <el-button @click="btjingbiao" class="btjingbiao" type="primary" round >确认竞标</el-button>
    </div>
</template>
<script>
import { designerdemanddoBid,designerdemand } from '@/request/api';
export default {
  data() {
    return {
        designerdemanddata:{},
        jingbiaoFrom:{
            designer_demand_id:'',
            mobile:'',
            bidding_charge:'',
            qq:'',
            remark:'',
        },
        rules: {
            bidding_charge: [
                { required: true, message: '请输入出价', trigger: 'blur' }
            ],
        },
    }
  },
  mounted() {

  },
  methods: {
      setid(id){
          this.jingbiaoFrom.designer_demand_id = id;
          this.getdesignerdemand();
      },
      getdesignerdemand(){
            designerdemand({id:this.jingbiaoFrom.designer_demand_id}).then(res => {
                if(res.ok){
                    this.designerdemanddata = res.data;
                }
            })
            
        },
      btjingbiao(){
        this.$refs['jbFrom'].validate((valid) => {
            if (valid) {
                designerdemanddoBid(this.jingbiaoFrom).then(res => {
                    if(res.ok){
                        this.seriesGallerys = res.data;
                        this.$message({
                            message: '提交竞标成功',
                            type: 'success'
                        });
                        this.$emit('close');
                    }
                })
            }
            
        });
      },
    //   bt(){
    //       window.open("https://erp.knoya.com/apply_designer_fixed/"+this.jingbiaoFrom.designer_demand_id+"/proposer");
    //   }
  },
  components: {
        
  },

}
</script>
